package school;

public class Test {
    public static void main(String[] args) {
        // 创建教师
        Teacher teacher1 = new Teacher("T001", "张老师", "男");
        Teacher teacher2 = new Teacher("T002", "李老师", "女");

        // 创建课程
        Course course1 = new Course("C001", "Java 编程", "A101", "周一 8:00-10:00");
        Course course2 = new Course("C002", "数据结构", "B202", "周二 14:00-16:00");

        // 教师开课（建立教师与课程的关联）
        teacher1.setCourse(course1);
        teacher2.setCourse(course2);
        course1.setTeacher(teacher1);
        course2.setTeacher(teacher2);

        System.out.println("教师信息：");
        System.out.println(teacher1);
        System.out.println(teacher2);

        // 创建学生
        Student student1 = new Student("S001", "小明", "男");
        Student student2 = new Student("S002", "小红", "女");

        System.out.println("\n学生初始信息：");
        System.out.println(student1);
        System.out.println(student2);

        // 学生选课
        student1.selectCourse(course1);
        student2.selectCourse(course2);

        System.out.println("\n学生选课之后：");
        System.out.println(student1);
        System.out.println(student2);

        // 打印学生课表
        System.out.println("\n学生课表：");
        student1.printCourseTable();
        student2.printCourseTable();

        // 学生退课
        student1.dropCourse();

        System.out.println("\n学生退课之后：");
        student1.printCourseTable();
    }
}